#pragma once
#include "component.h"
#include "../render/Animation.h"

#include <vector>

namespace gui {

class MPanel : public gui::Component
{
public:
    MPanel(const gui::Component* c) : gui::Component(c) {};

    /** Add a background Image */
    void AddBackgroundImage( Image image ) { 
        m_images.push_back( image ); 
        m_animation.SetNumOfFrames( m_images.size() );
    };
    /** Set an animation to the image */
    void SetFPS( int fps ) { m_animation.SetFPS( fps ); };

    /** update the animations */
    void Update( long dt );

    /** Render the panel */
    void Render( IRender* r );

private:
    // An image for the panel
    typedef std::vector< Image >  type_ImageList;
    type_ImageList m_images;
    // an animation for the background
    Animation   m_animation;


public:
    virtual ~MPanel(void) {};
};

};